"""usercenter URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf import settings
from django.conf.urls import url, include
from django.contrib import admin

from modernrpc.views import RPCEntryPoint
from modernrpc.core import JSONRPC_PROTOCOL
from usercenter.apps.userauth.admin_view import ZXObtainJSONWebToken, AdminAuthViewSet
from rest_framework_swagger.views import get_swagger_view
schema_view = get_swagger_view(title='usercenter API',)

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^admin_login', ZXObtainJSONWebToken.as_view()),
    url(r'^admin_register', AdminAuthViewSet.as_view({'post': 'reg'})),
    url(r'^rpc/', RPCEntryPoint.as_view(protocol=JSONRPC_PROTOCOL), ),
    # url(r'^uc/cas/', include('usercenter.apps.cas_client.urls')),
    url(r'^uc/userauth/', include('usercenter.apps.userauth.urls')),
    url(r'^uc/customer/', include('usercenter.apps.customer.urls')),
    url(r'^uc/staff/', include('usercenter.apps.staff.urls')),
    url(r'^uc/sms/', include('usercenter.apps.sms.urls')),
]


if settings.DEBUG:
    urlpatterns += [
        url(r'^docs', schema_view),
    ]
    from django.conf.urls.static import static

    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
